package org.lc.design.samples.case1.threadsafe;

import java.util.Properties;

/**
* 线程安全-enum实现
* @author lc
* @date 2024/7/8
*/
public enum EnumConfigureManager {

    INSTANCE;

    private Properties properties;

    EnumConfigureManager() {
        properties = new Properties();
        properties.setProperty("appName", "单例模式模拟");
        properties.setProperty("port", "8081");
    }

    public String getConfig(String key) {
        return properties.getProperty(key);
    }
}
